package com.yhsimon.realm.member.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum BeanUsageCodeEnum {

    SIGN_IN(1, "签到"),
    PUBLISH_ARTICLE(2, "发表文章"),
    COMMENT(3, "评论"),
    ACTIVITY(4, "活动"),
    CONSUME(5, "消费"),
    ;


    private Integer code;
    private String name;

    public static String getUsageModeName(int code) {
        for (BeanUsageCodeEnum beanUsageCode : BeanUsageCodeEnum.values()) {
            if (beanUsageCode.getCode() == code) {
                return beanUsageCode.getName();
            }
        }
        return null; // 或者抛出一个异常，如果id无效
    }


}
